def create_table(table_name, column_families):
    script = 'create '+"'" + table_name+"'"
    for column_family in column_families:
        script += ',' + "'" + column_family+"'"
    print(script)


def put_data(table_name, row_key, column_family, column, data):
    print("put '" + table_name + "'"+',' + "'" + row_key + "'" + ',' +
          "'"+column_family + ':' + column+"'" + ',' + "'"+data+"'")


if __name__ == '__main__':
    column_families = ['Description', 'Courses', 'Home']
    table_name = "students"
    create_table(table_name, column_families)
    row_list = ["001", "002", "003"]
    column_qualifiers = {column_families[0]: ["Name", "Height"],
                         column_families[1]: ["Chinese", "Math", "Physics"],
                         column_families[2]: ["Province"]
                         }
    rows_datas = [["Li Lei", "176", "80", "90", "95", "Zhejiang"],
                  ["Han Meimei", "183", "88", "77", "66", "Beijing"],
                  ["Xiao Ming", "162", "90", "90", "90", "Shanghai"]]
    for i in range(len(rows_datas)):
        index = 0
        for j, column_family in enumerate(column_families):
            for k, column_qualifier in enumerate(column_qualifiers.get(column_family)):
                put_data(table_name, row_list[i], column_family,
                         column_qualifier, rows_datas[i][index])
                index+=1